<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateStudentEvaluationsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('student_evaluations', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('users_id')->comment("用户id");
            $table->unsignedInteger('course_id')->comment("课程id");
            $table->unsignedInteger('class_grades_id')->comment("班级id");
            $table->unsignedInteger('course_section_id')->comment("课程章节id");
            $table->unsignedInteger('score')->comment("分数")->default(0)->nullable();
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('student_evaluations');
    }
}
